home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 October / EnigmA AMIGA RUN 22 (1997)(G.R. Edizioni)(IT)[!][issue 1997-10 & 11][EAR-CD VI].iso / recent2 / cccc.lha / myheader.h < prev   
C/C++ Source or Header  |  1997-09-07  |  2KB  |  79 lines

  1. /*
  2.    myheader.h - Useful #defines and typedefs for tool/accessory programs.
  3. */
  4.  
  5. #ifndef MYHEADER_H
  6. #define MYHEADER_H
  7.  
  8. /* Length of tool/accessory id. */
  9. #define ID_LEN 4
  10.  
  11. /* Make an id out of four characters. */
  12. #define MAKE_ID(a, b, c, d)    ((ULONG) ((((a << 8) + b << 8) + c << 8) + d))
  13.  
  14. /* Make an id out of a string. */
  15. #define MAKE_IDS(s)        (MAKE_ID(s[0], s[1], s[2], s[3]))
  16.  
  17. /* Split an id into four characters. */
  18. #define SPLIT_ID(id, a, b, c, d)    \
  19. do {                    \
  20.   a = (UBYTE) ((id >> 24) & 0xff);    \
  21.   b = (UBYTE) ((id >> 16) & 0xff);    \
  22.   c = (UBYTE) ((id >> 8) & 0xff);    \
  23.   d = (UBYTE) (id & 0xff);        \
  24. } while (0)
  25.  
  26. /* Split an id into a string. */
  27. #define SPLIT_IDS(id, s)        \
  28. do {                    \
  29.   SPLIT_ID(id, s[0], s[1], s[2], s[3]);    \
  30. } while (0)
  31.  
  32. /* Maximum MIDI note # */
  33. #define MIDI_NOTE_MAX (127)
  34.  
  35. /* Number of MIDI notes. */
  36. #define MIDI_NOTE_NUM (MIDI_NOTE_MAX + 1)
  37.  
  38. /* Flags for use in the BRB file requester. */
  39. #define FILES_DELETE    1        /* Delete button */
  40. #define FILES_OPEN    2        /* Open button */
  41. #define FILES_SAVE    4        /* Save button */
  42. #define    FILES_TEST    8        /* ??? */
  43. #define FILES_TYPE    16        /* Type string gadget */
  44. #define    FILES_PATH    32        /* Path string gadget */
  45.  
  46. /* Initial placement of tool/accessory windows. */
  47. #define INITIAL_LEFT    50
  48. #define INITIAL_TOP    50
  49.  
  50. /* Unprototyping cast. */
  51. typedef __geta4 long (*no_prototype)();
  52.  
  53. /* Void cast. */
  54. typedef __geta4 void (*void_prototype)();
  55.  
  56. /* Event *cast. */
  57. typedef __geta4 struct Event *(*event_prototype)();
  58.  
  59. /* For non-stdio debugging messages. */
  60. #define DEBUG(message)                        \
  61. do {                                \
  62.   struct EasyStruct es = {                    \
  63.     sizeof(struct EasyStruct),                    \
  64.     0,                                \
  65.     "Debugging information",                    \
  66.     "Message: %s",                        \
  67.     "OK"                            \
  68.     };                                \
  69.   (void) EasyRequest(functions->window, &es, 0, message);    \
  70. } while (0)
  71.  
  72. #define NOTE_LENGTH(x)    (768 >> (x))
  73.  
  74. #define MBC_STRING_LENGTH 12
  75.  
  76. #define CLOCKSPERMEASURE 768L
  77.   
  78. #endif    /* MYHEADER_H */
  79.